package com.heima.datasync.controller.v1;
import com.heima.datasync.service.EsDataService;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author admin
 */
@RestController
@RequestMapping("esdata")
public class DataSyncController {

    @Resource
    EsDataService esDataService;

    /**
     * @return 初始化结果
     * @Description 初始化es数据库：查询文章信息存放到es中
     */
    @GetMapping("init")
    public ResponseResult esDataInit(){
        return esDataService.dataInit();
    }
}